# -*- coding: utf-8 -*-
"""AI引擎模块"""

from .doubao_engine import DoubaoEngine
from .deepseek_engine import DeepSeekEngine
from .gemini_engine import GeminiEngine




class AIEngineFactory:
    """AI引擎工厂类"""
    
    @staticmethod
    def create_engine(provider="doubao", model=None, temperature=None, top_p=None, key_id=None):
        """
        创建AI引擎实例
        
        Args:
            provider: AI提供商（doubao/deepseek/gemini）
            model: 模型名称
            temperature: 温度参数
            top_p: top_p参数
            key_id: 密钥ID
        
        Returns:
            AI引擎实例
        """
        if provider == "doubao":
            return DoubaoEngine(
                key_id=key_id,
                model=model,
                temperature=temperature,
                top_p=top_p
            )
        elif provider == "deepseek":
            return DeepSeekEngine(
                key_id=key_id,
                model=model,
                temperature=temperature,
                top_p=top_p
            )
        elif provider == "gemini":
            return GeminiEngine(
                key_id=key_id,
                model=model,
                temperature=temperature,
                top_p=top_p
            )
        else:
            raise ValueError(f"不支持的AI提供商: {provider}")

